#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <cstring>
#include <iostream>
using namespace std;
vector<pair<int,int> > DP[111111];
/*
vector<int> dp(int N) {  
  int i,j ,k;
  if (DP[N].size()) return DP[N];
  for (i = 3; i <= 100 ; ++i) {
    for (j = 0; j < i; ++j) {
      int total = i * (i-1) * (i-2) / 6 - j * (j-1) * (j-2) / 6 - (i-j) * (j *
          (j-1) /2);
      if (total > N) continue;
      vector<pair<int,int> > vec = dp(N - total);
      vec.push_back(make_pair(i,j));
      int sum1, sum2; sum1=sum2=0;
      for (j = 0; j < vec.size(); ++j) sum1 += abs(vec[j].first);
      for (j = 0; j < DP[N].size(); ++j) sum2 += abs(DP[N][j].first);
      if (DP[N].size() == 0) DP[N] = vec;
      else if (sum1 < sum2) DP[N] = vec;
    }
  }

    
  return DP[N];
}
*/

int main() {
  int i, j, k;
  int N; cin >> N;
  int mat[111][111];
  memset(mat, 0, sizeof(mat));
  int ind = 0;
  int cant = 3;
  while (cant * (cant-1) * (cant-2) / 6 <= N) cant++;
  cant--;
  for (i = ind; i < ind+cant; ++i)
    for (j = i + 1; j < ind+cant; ++j)
      mat[i][j] = mat[j][i] = 1;
  ind = ind+cant; 
  N -= ((cant*(cant-1)*(cant-2))/6);

  // pasamos a poner de a dos... 
  while (N) {
    int cant2 = 1;
    while (cant2 <= cant && (cant2 * (cant2-1)) / 2 <= N )cant2++;
    cant2--;
    //cout << N << " H " << cant2 << endl;
    //break;
    for (i = 0; i < cant2; ++i) {
      mat[i][ind] = mat[ind][i] = 1;
    }
    ind ++;
    N -= (cant2 * (cant2-1))/2;
  }
/*

  vector<int> vec = dp(N);
  for (k = 0; k < vec.size(); ++k) {
    int cant = vec[k]; 
    // ponemos desde ind lo q corresponda...
    for (i = ind; i < ind+cant; ++i)
      for (j = i + 1; j < ind+cant; ++j)
        mat[i][j] = mat[j][i] = 1;
    ind = ind+cant; 
    N -= ((cant*(cant-1)*(cant-2))/6);
  }
 */ 
  cout << ind << endl;
  for (i = 0; i < ind; ++i) {
    for (j = 0; j < ind; ++j) cout << mat[i][j];
    cout << endl;
  }

  return 0;
}
